package com.gitee.wsl.struct.grammar.node.expr.math

import com.gitee.wsl.struct.grammar.node.ASTNode
import com.gitee.wsl.struct.grammar.node.LeafNode
import com.gitee.wsl.struct.grammar.node.Node
import com.gitee.wsl.struct.grammar.node.NodeType


class UnaryExpr(expr: ASTNode, val operator: LeafNode) : Node(listOf(expr),type = NodeType.EXPR) {
    val expr: ASTNode
        get() = this.children[0]

    override fun toString(): String = "($expr$operator)"
}